<?php
use app\components\AreaDecorator;
use yii\widgets\Block;
use yii\widgets\Breadcrumbs;
use app\components\Alert;
use app\models\User;
?>
<?php AreaDecorator::begin(['viewFile'=>'@app/views/layouts/main.php'])?>
<?php Block::begin(['id' =>'content']);?>
<div class='row'>
<?= Breadcrumbs::widget([
    'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ]) ?>
<?= Alert::widget() ?>
    <div class="col-xs-2" style="padding-top:50px">
        <?php $aid = yii::$app->controller->action->id; if($aid == "emailone" || $aid == "emailgroup" || $aid == "emailsent" || $aid == "viewemail"):?>
            <a class="btn btn-info" href="<?= yii::$app->urlManager->createUrl('message/emailone');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Email Compose')?></a>
            <a class="btn btn-primary" href="<?= yii::$app->urlManager->createUrl('message/emailgroup');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Group Compose')?></a>
            <a class="btn btn-success" href="<?= yii::$app->urlManager->createUrl('message/emailsent');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Sent Box')?></a>
        <?php else:?>
            <a class="btn btn-primary" href="<?= yii::$app->urlManager->createUrl('message/create');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Compose')?></a>
            <?php if(!yii::$app->user->isGuest && (yii::$app->user->identity->checkAccess(User::ROLE_ADMIN) || 
                yii::$app->user->identity->checkAccess(User::ROLE_TEACHER))):?>
            <a class="btn btn-success" href="<?= yii::$app->urlManager->createUrl('message/groupcompose');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Group Compose')?></a>
            <?php endif;?>
            <a class="btn btn-info" href="<?= yii::$app->urlManager->createUrl('message/inbox');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Inbox')?></a>
            <a class="btn btn-warning" href="<?= yii::$app->urlManager->createUrl('message/sent');?>" style="width:100%;margin-bottom:10px"><?php echo yii::t('Message','Sent Box')?></a>
        <?php endif;?>
    </div>
    <div class="col-xs-10">
        <?= $content ?>
    </div>
</div>
<?php Block::end();?>
<?php AreaDecorator::end();?>
